<template>
	<view class="PT_2">
		<view class="P_2">
			<view class="B_radius_5 P_2 bg_fff flex_row_between MB_2" v-for="(item,i) in aList" :key='i'>
				<view class="">
					<view class="color_gray PB_1 fontS_12">
						{{item.change_time}}
					</view>
					<view class="font_weight_bold fontS_16">
						KSA
					</view>
				</view>
				<view class="flex_col_evenly">
					<view class=" PB_1">
						{{item.desc}}
					</view>
					<view class="font_weight_bold fontS_16">
						{{item.change_money}}
					</view>
				</view>
			</view>
			<view class="flex_rowC PTB_3">
				{{showText}}
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				aList:[],
				page:1,
				showText:'',
				state:true,
			}
		},
		onLoad() {
			this.getAList()
		},
		onReachBottom() {
			if (this.state) {
				this.showTxt = '加载中...';
				this.page++
				this.getAList();
			}
		
		},
		onPullDownRefresh() {
			this.getAList();
			setTimeout(()=>{
				uni.stopPullDownRefresh();
			},1000)
		},
		methods: {
			getAList(){
				let _this = this;
				this.$req('account/accountLog',{currency_id:1,page:_this.page},function(res){
					if(res.code==1){
						if(res.data.list.length>0){
							if(res.data.page==1){
								_this.aList = res.data.list
							}else{
								_this.aList = _this.aList.concat(res.data.list)
							}
						}else{
							_this.showText = '没有更多了';
							_this.state = false;
						} 
						
						
					}
				})
			},
		}
	}
</script>

<style>

</style>
